home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1995 November
/
EnigmA AMIGA RUN 02 (1995)(G.R. Edizioni)(IT)[!][issue 1995-11][Skylink CD].iso
/
earcd
/
util
/
cli
/
0utils.lha
/
0Utils
/
ScriptName.data
< prev
next >
Wrap
Text File
|
1995-08-19
|
2KB
|
100 lines
#ifdef TPLTER
ScriptName = {
SHORT = {{ output the (temp) name of the current script }};
DESCRIPTION = {{
ScriptName just tries to output the contents of
process->cli->commandfile. this value is defined only,
if:
1) the command was called from inside a script, AND
2) the script had to be buffered in "T:Command-??-???"
this is, e.g. if the script contained a ".KEY"
directive or was read from an interactive device.
RESULT
"T:Command-xx-Tyy" if possible.
}};
BUGS = {{
If not run from within a script produces error
ERROR_OBJECT_WRONG_TYPE (I found no better error)
}};
EXAMPLES = {{
>ScriptName
"ScriptName: object is not of required type"
(Was: "* Not in a Script *")
>echo "scriptname" | srun execute in:
"T:Command-00-T04"
}};
BUGS = {{
The result is most likely something like
'T:Command-??-T??' with ? being numbers,
if the system 'decided' to create a tempfile;
Up to now we can not get another result,
for if no tempfile is created, we get an
empty string =8-(.
}};
HISTORY = {{
16-02-95 b_noll created
20-02-95 b_noll restructured source
21-02-95 b_noll added version/format-prefix/offset
27-02-95 b_noll replace BSTR extraction by FPrintf %b
20-03-95 b_noll added args diagnostics
19-08-95 b_noll created .data file
}};
// Template = ",";
// Arguments = {{
// int dummy;
// }};
version = "1.2";
body = {{
//struct Process *pr;
struct CommandLineInterface *cli;
//pr = (struct Process *)FindTask(NULL);
if (cli = Cli()) {
if (cli->cli_Interactive) {
retval = RETURN_ERROR;
SetIoErr(ERROR_OBJECT_WRONG_TYPE);
//PutStr ("* Not in a Script *\n");
} else if (cli->cli_CommandFile) {
//from = BADDR(cli->cli_CommandFile);
/* Bah! this is in fact a _PSEUDO_ BSTR: 'len' is totally undefined */
//// this would be: get BSTR
//while (len--)
// if (!(buffer[len] = from[len]))
// buffer[len] = '\0';
retval = RETURN_OK;
FPrintf(Output(), "%b\n", cli->cli_CommandFile);
} else {
retval = RETURN_WARN;
//PutStr ("* No ScriptName *\n");
SetIoErr(ERROR_OBJECT_NOT_FOUND);
} /* if */
} else {
SetIoErr(ERROR_OBJECT_WRONG_TYPE);
} /* if */
}};
};
#endif